import java.awt.BorderLayout;
import java.awt.ComponentOrientation;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * 
 */

/**
 * @author pt186002
 *
 */
public class AttendanceReportMainScreen extends JFrame implements ActionListener{
	private JComboBox m_month, m_year, m_reportType;
	private JButton btn_reset,btn_report;
	private JPanel m_centralPanel,m_leftPanel,m_firstPanel;
	public AttendanceReportMainScreen()
	{
		super( "Report generation" );
		
	}
	
	public void startScreen()
	{
		FlowLayout flowLayout = new FlowLayout(FlowLayout.CENTER);
		
		setLayout(flowLayout);
		setResizable(false);
		
		m_centralPanel = new JPanel();
		m_leftPanel=new JPanel();
		m_firstPanel=new JPanel();
		
		
		add(m_firstPanel);
		add(m_centralPanel);
		add(m_leftPanel);
		
		m_firstPanel.setBorder(BorderFactory.createTitledBorder("Report Type"));
        m_centralPanel.setBorder(BorderFactory.createTitledBorder("Month and year"));
        m_leftPanel.setBorder(BorderFactory.createTitledBorder(""));
		
        
        m_firstPanel.add(new JLabel(" Select Type of Report : "));
        JComboBox jj=new JComboBox();
        jj.addItem("");
         jj.addItem("Working Details");
         jj.addItem("Leave Details");
         m_firstPanel.add(jj);

        m_centralPanel.add(new JLabel(" Select month : "));
         
        
        JComboBox j_month=new JComboBox();
		j_month.addItem("");
		for (int i=1;i<=12;i++)
			j_month.addItem(""+i);
			
			
		m_centralPanel.add(j_month);
		
        m_centralPanel.add(new JLabel(" Select Year : "));
        
        
JComboBox j_year=new JComboBox();
		j_year.addItem("");
		for (int i=2010;i<=2020;i++)
			 j_year.addItem(""+i);
		
        
		m_centralPanel.add(j_year);
		
		btn_reset=new JButton("Reset");
		btn_report=new JButton("Generate report");
		
		btn_report.setToolTipText("Report Button");
		m_leftPanel.add(btn_reset);
		m_leftPanel.add(btn_report);
		
		btn_report.addActionListener(this);
		btn_reset.addActionListener(this);
		
		
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		// make the frame half the height and width
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		int height = screenSize.height;
		int width = screenSize.width;
		setSize(width/2, height/2);

		// here's the part where i center the jframe on screen
		setLocationRelativeTo(null);
		setVisible(true);

	}	
		public void actionPerformed(ActionEvent e)
		{
			if(btn_report==e.getSource())
			{
			//	AttendanceReportGenerate attandance_Report=new AttendanceReportGenerate();			
		}
		
		if(btn_reset==e.getSource())
		{
			// m_reportType.setT("");
			 /*m_reportType.setSelectedItem("");
			 m_month.setSelectedItem("");
			 m_year.setSelectedItem("");*/
		}
	}
}
